﻿using Microsoft.EntityFrameworkCore;

namespace BDQN.Entites
{
    public class BlogSysDbContext :DbContext
    {
        public BlogSysDbContext(DbContextOptions<BlogSysDbContext> options) : base(options)
        {

        }


        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            //在这个里面可以给某些表带有一个初始数据
            modelBuilder.Entity<Roles>().HasData(
                new Roles {Id=1 ,Title = "普通管理员" },
                new Roles {Id=2 , Title = "超级管理员" }
                );
        }




        public DbSet<AdminsPermission> About {  get; set; }
        public DbSet<Achievement> Achievement { get; set; }
        public DbSet<Admins> Admins { get; set; }
        public DbSet<AdminsPermission> AdminsPermission { get; set; }
        public DbSet<Banner> Banner { get; set; }
        public DbSet<Blog> Blog { get; set; }
        public DbSet<BlogTag> BlogTag { get; set; }
        public DbSet<Copyright> Copyright { get; set; }
        public DbSet<Roles> Roles { get; set; }
        public DbSet<Seos> Seos { get; set; }
        public DbSet<Skills> Skills { get; set; }
        public DbSet<SystemMenus> SystemMenus { get; set; }
        public DbSet<Tags> Tags { get; set; }
        public DbSet<WebMenus> WebMenus { get; set; }
        public DbSet<Works> Works { get; set; }


    }
}
